<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String path = request.getContextPath(); %>
<script>
    var path = "${pageContext.request.contextPath}";
    $(function () {
        $.get(
            path+"zhuang/common/ajaxCount",
            function (msg) {
                if (msg!="0")
                {
                    document.getElementById("noticeDot-0").className= "red";
                    $("#noticeNo").html('('+msg+')');
                    $(".count3").html("<strong>"+msg+"</strong>条新投递反馈");
                    document.getElementById("noticeTip").className = "";
                }
                else
                {
                    document.getElementById("noticeDot-0").className= "";
                    $("#noticeNo").html("");
                    document.getElementById("noticeTip").className = "dn";
                }
            });
    });


</script>

<script>
    var path = "${pageContext.request.contextPath}";
    $(function () {
        $.get(
            path+"zhuang/common/ajaxCompany",
            function (msg) {
                if (msg!="0")
                {

                    document.getElementById("noticeDot-0").className= "red";
                    $("#noticeNo").html('('+msg+')');
                    $(".count3").html("<strong>"+msg+"</strong>条新投递反馈");
                    document.getElementById("noticeTip").className = "";
                }
                else
                {
                    document.getElementById("noticeDot-0").className= "";
                    $("#noticeNo").html("");
                    document.getElementById("noticeTip").className = "dn";
                }

            });

    });

</script>
<script type="text/javascript">
    $(function(){
        $('#noticeDot-1').hide();
        $('#noticeTip a.closeNT').click(function(){
            $(this).parent().hide();
        });
    });
</script>
<script>
    $(function(){
        var url = document.URL;
        $("#navheader li a").each(function(){
            var sign = $(this).html();
            if(url.includes("index")&&sign=="首页"){
                $(this).parent().addClass("current");
            }
            if(url.includes("job")&&sign=="职位"){
                $(this).parent().addClass("current");
            }
            if(url.includes("companylist")&&sign=="公司"){
                $(this).parent().addClass("current");
            }
            if(url.includes("jianli")&&sign=="我的简历"){
                $(this).parent().addClass("current");
            }
            if(url.includes("deliver")&&sign=="历史投递"){
                $(this).parent().addClass("current");
            }
            if(url.includes("positions")&&sign=="简历管理"){
                $(this).parent().addClass("current");
            }
            if(url.includes("create")&&sign=="发布职位"){
                $(this).parent().addClass("current");
            }
        });
    });
</script>

<div id="header">
    <div class="wrapper">
        <a href="/index.jsp" class="logo">
            <img src="<%=path%>/static/web/images/logo.png" width="229" height="43" alt="壮壮招聘网" />
        </a>

        <ul class="reset" id="navheader">
            <c:forEach items="${requestScope.webMenus}" var="webMenu" varStatus="stat" end="1">
                <c:if test="${stat.first}">
                    <li><a href="${webMenu.url}">${webMenu.title}</a></li>
                </c:if>
            </c:forEach>
            <c:forEach items="${requestScope.webMenus}" varStatus="stat" var="webMenu" begin="1">

                <c:if test="${stat.count le 2}">
                    <li><a href="${webMenu.url}">${webMenu.title}</a></li>
                </c:if>
                <c:if test="${stat.count gt 2}">
                    <%--游客显示--%>
                    <c:if test="${sessionScope.userinfo==null && sessionScope.company==null && webMenu.useable==null}">
                        <script>
                            $("#userChange").remove();
                            $("#companyChange").remove();
                        </script>
                        <li id="change"><a href="${webMenu.url}">${webMenu.title}</a></li>
                    </c:if>
                    <%--个人显示--%>
                    <c:if test="${sessionScope.userinfo!=null && webMenu.useable==false}">
                        <script>
                            $("#change").remove();
                            $("#companyChange").remove();
                        </script>
                        <li id="userChange"><a href="${webMenu.url}">${webMenu.title}</a></li>
                    </c:if>
                    <%--公司显示--%>
                    <c:if test="${sessionScope.company!=null && webMenu.useable}">
                        <script>
                            $("#change").remove();
                            $("#userChange").remove();
                        </script>
                        <c:if test="${webMenu.title ne '发布职位'}">
                            <li id="companyChange"><a href="${webMenu.url}">${webMenu.title}</a></li>
                        </c:if>
                        <c:if test="${webMenu.title eq '发布职位'}">
                        <li id="companyChange">
                                <a href="
                                    <c:if test="${company.opened}">${webMenu.url}</c:if>
                                    <c:if test="${!company.opened}">/zhuang/company/openstep1</c:if>
                                ">${webMenu.title}</a>
                        </li>
                        </c:if>
                    </c:if>
                </c:if>

            </c:forEach>
        </ul>
        <%--游客显示--%>
        <c:if test="${sessionScope.userinfo==null&&sessionScope.company==null}">
            <ul class="loginTop">
                <li><a href="/zhuang/login" rel="nofollow">登录</a></li>
                <li>|</li>
                <li><a href="/zhuang/register" rel="nofollow">注册</a></li>
            </ul>
        </c:if>
        <%--个人显示--%>
        <c:if test="${sessionScope.userinfo!=null}">
            <dl class="collapsible_menu">
                <dt>
                    <span>${sessionScope.userinfo.username}</span>
                    <!--接收消息的红点-->
                    <div class="hongdian">
                        <span class="" id="noticeDot-0"></span>
                        <i></i>
                    </div>

                </dt>
                <dd><a rel="nofollow" href="/zhuang/user/jianli">我的简历</a></dd>

                <dd style="display: none;">
                    <a href="/zhuang/user/delivery">
                        投递记录<span id="noticeNo" class="red"></span>
                    </a>
                </dd>


                <dd><a href="/zhuang/user/collections">我收藏的职位</a></dd>
                <dd class="btm">
                    <a href="/zhuang/user/subscribeList">
                        我的订阅<span id="subscribe" class="red"></span>
                    </a>

                </dd>
                <dd><a href="/zhuang/accountBind">帐号设置</a></dd>
                <dd class="logout"><a rel="nofollow" href="/zhuang/exit">退出</a></dd>
            </dl>


        </c:if>
        <%--公司显示--%>
        <c:if test="${sessionScope.company!=null}">
            <dl class="collapsible_menu">
                <dt>
                    <span>${sessionScope.company.username}</span>
                    <div class="hongdian">
                        <span class="" id="noticeDot-0"></span>
                        <i></i>
                    </div>
                    <%--<span class="red dn" id="noticeDot-1"></span>
                    <i></i>--%>
                </dt>
                <dd><a href="/zhuang/company/positions">我发布的职位</a></dd>
                <dd><a href="/zhuang/company/pending">我收到的简历<span id="noticeNo" class="red"></span>
                </a></dd>
                <dd class="btm"><a href="/zhuang/company/myhome?id=${sessionScope.company.id}">我的公司主页</a></dd>
                <dd><a href="/zhuang/accountBind">帐号设置</a></dd>
                <dd class="logout"><a rel="nofollow" href="/zhuang/exit">退出</a></dd>
            </dl>
            <div class="dn" id="noticeTip" >
                <span class="bot"></span>
                <span class="top"></span>
                <a target="_blank" href="/zhuang/company/pending" class="count3"></a>
                <a class="closeNT" href="javascript:;"></a>
            </div>
        </c:if>
    </div>
</div>
<!-- end #header -->